<?php

	class admin_model extends st_model {
		protected $_instance  = array(
										  'table'      => 'admin_user', 
										  'primaryKey' => 'id',
									  );
		public function getUserUrl() 
		{
			return site_url('admin/system/user/edit/id/' . $this->getId(), true);
		}
		
		public function getIndexUrl($param = '') 
		{
			return site_url('admin/system/user/index/' . $param, true);
		}
		
		public function login($username, $password) {
			$this->addAttributeToFilter('username', $username, 'LIKE');
			$this->addAttributeToFilter('password', md5($password), 'LIKE');
			$this->loadByFilter(st_model::LOAD_ALL_ATTRIBUTE);
			if ($this->isLoaded()) {
				return true;
			}
			return false;
		}
	}	
?>